<!DOCTYPE html>
<html lang="en" ng-app="AldeasInfantiles">
<head>
  <title>Aldeas Infantiles | Administrar Donadores</title>
  <?php
	  $this->load->view('head_view');
  ?>
  <script src="<?php echo base_url("assets/js/donors-view.js"); ?>"></script>
  <script src="<?php echo base_url("assets/js/menu-view.js"); ?>"></script>
</head>
<body>
  <div class="container">
    <div class="masthead">
      <?php
        $this->load->view('nav_view');
      ?>
    </div>
    <div class="jumbotron" ng-controller="Donors">
      <form class="form-horizontal" role="form" id="form-edit-donor">
          <h4>Editar Donadores <span class="glyphicon glyphicon-user"></span></h4>
          <div class="row">
            <div class="col-xs-4">
              <label for="add-donor-search" class="col-sm-12 control-label">Buscar:</label>
            </div>
            <div class="col-xs-4">
              <a href="#" data-toggle="modal" data-target="#modal-donors" ng-click="showDonors()"><span class="glyphicon glyphicon-search"></span> Buscar</a>
            </div>
          </div>
          <div class="row hide">
            <div class="col-xs-4">
              <label for="donorid" class="col-sm-12 control-label">Identificador:</label>
            </div>
            <div class="col-xs-4">
              <input type="text" class="form-control" ng-model="donor.donorid" id="donor.donorid" name="donor.donorid" disabled>
            </div>
          </div>
          <div class="row">
            <div class="col-xs-4">
              <label for="donorname" class="col-sm-12 control-label">Nombre:</label>
            </div>
            <div class="col-xs-4">
              <input type="text" class="form-control" ng-model="donor.donorname" id="donor.donorname" name="donor.donorname" placeholder="Nombre" required>
            </div>
          </div>
          <div class="row">
            <div class="col-xs-4">
              <label for="donortel" class="col-sm-12 control-label">Tel&eacute;fono:</label>
            </div>
            <div class="col-xs-4">
              <input type="tel" class="form-control" ng-model="donor.donortel" id="donor.donortel" name="donor.donortel" placeholder="Tel&eacute;fono" min="8" max="8" required>
            </div>
          </div>
          <div class="row">
            <div class="col-xs-4">
              <label for="donormail" class="col-sm-12 control-label">Correo:</label>
            </div>
            <div class="col-xs-4">
              <input type="email" class="form-control" ng-model="donor.donormail" id="donor.donormail" name="donor.donormail" placeholder="Correo" required>
            </div>
          </div>
          <div class="row">
            <div class="col-xs-4">
              <label for="selectedCountry" class="col-sm-12 control-label">Pa&iacute;s</label>
            </div>
            <div class="col-xs-4">
              <select id="selectedCountry" name="selectedCountry" class="form-control" title="Seleccione el pa&iacute;s del usuario" ng-change="requestDorps()"
                ng-model="selectedCountry"
                ng-options="country.id_pais as country.ds_pais for country in countries"
                >
              </select>
            </div>
          </div>
          <div class="row">
            <div class="col-xs-4">
              <label for="donordir" class="col-sm-12 control-label">Direcci&oacute;n</label>
            </div>
            <div class="col-xs-4">
              <textarea rows="2" cols="30" ng-model="donor.donordir" id="donor.donordir" name="donor.donordir">
              </textarea>
            </div>
          </div>
          <div class="row">
            <div class="col-xs-4">
            </div>
            <div class="col-xs-4">
              <input type="reset" class="btn btn-default" value="Cancelar"  />
              <input type="submit" class="btn btn-primary" value="Guardar" ng-click="getParams(donor)" />
              <div id="messages-users" class="alert alert-dismissable {{alertClass}} {{hiddenClass}}">
                <strong>Mensaje!</strong> <span>{{errorMessage}}</span>
              </div>
            </div>
          </div>
      </form>

      <div class="modal fade" id="modal-donors" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <h4 class="modal-title">Seleccione un donador</h4>
          </div>
              <div class="modal-body">
          <form class="form-horizontal" role="form" id="user-form">
            <div class="row">
              <div class="col-xs-2">
                <h5>Filtrar:</h5>
              </div>
              <div class="col-xs-4">
                <input type="text" class="form-control" placeholder="Nombre del donador" ng-model="query" id="userfilter" name="userfilter" value="" size="25" />
              </div>
            </div>
            <div class="list-group" role="navigation">
              <a ng-repeat="donor in donors | filter:query" ng-click="getDonorById(donor, $event)" href="" class="list-group-item">{{donor.ds_donador}}</a>
            </div>
          </form>
              </div>
            </div><!-- /.modal-content -->
          </div><!-- /.modal-dialog -->
      </div>
    </div>
    <?php
      $this->load->view('footer_view');
    ?>
  </div>
</body>
</html>